package com.haixiaoke.saas.house.service.impl;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.house.domain.HouseOperatingRecord;
import com.haixiaoke.saas.house.mapper.HouseOperatingRecordMapper;
import com.haixiaoke.saas.house.service.IHouseOperatingRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 房屋操作记录Service业务层处理
 *
 * @author panda
 * @date 2023-10-26
 */
@Service
public class HouseOperatingRecordServiceImpl implements IHouseOperatingRecordService {
    @Autowired
    private HouseOperatingRecordMapper houseOperatingRecordMapper;

    /**
     * 查询房屋操作记录
     *
     * @param houseOperatingRecordId 房屋操作记录主键
     * @return 房屋操作记录
     */
    @Override
    public HouseOperatingRecord selectHouseOperatingRecordByHouseOperatingRecordId(String houseOperatingRecordId) {
        return houseOperatingRecordMapper.selectHouseOperatingRecordByHouseOperatingRecordId(houseOperatingRecordId);
    }

    /**
     * 查询房屋操作记录列表
     *
     * @param houseOperatingRecord 房屋操作记录
     * @return 房屋操作记录
     */
    @Override
    public List<HouseOperatingRecord> selectHouseOperatingRecordList(HouseOperatingRecord houseOperatingRecord) {
        return houseOperatingRecordMapper.selectHouseOperatingRecordList(houseOperatingRecord);
    }

    /**
     * 新增房屋操作记录
     *
     * @param houseOperatingRecord 房屋操作记录
     * @return 结果
     */
    @Override
    public int insertHouseOperatingRecord(HouseOperatingRecord houseOperatingRecord) {
        houseOperatingRecord.setCreateTime(DateUtils.getNowDate());
        return houseOperatingRecordMapper.insertHouseOperatingRecord(houseOperatingRecord);
    }

    /**
     * 修改房屋操作记录
     *
     * @param houseOperatingRecord 房屋操作记录
     * @return 结果
     */
    @Override
    public int updateHouseOperatingRecord(HouseOperatingRecord houseOperatingRecord) {
        return houseOperatingRecordMapper.updateHouseOperatingRecord(houseOperatingRecord);
    }

    /**
     * 批量删除房屋操作记录
     *
     * @param houseOperatingRecordIds 需要删除的房屋操作记录主键
     * @return 结果
     */
    @Override
    public int deleteHouseOperatingRecordByHouseOperatingRecordIds(String[] houseOperatingRecordIds) {
        return houseOperatingRecordMapper.deleteHouseOperatingRecordByHouseOperatingRecordIds(houseOperatingRecordIds);
    }

    /**
     * 删除房屋操作记录信息
     *
     * @param houseOperatingRecordId 房屋操作记录主键
     * @return 结果
     */
    @Override
    public int deleteHouseOperatingRecordByHouseOperatingRecordId(String houseOperatingRecordId) {
        return houseOperatingRecordMapper.deleteHouseOperatingRecordByHouseOperatingRecordId(houseOperatingRecordId);
    }
}
